
function chart11() {
    var option = {
        title: {
            text: '性别分布',
            left: 'center',
            textStyle: {
                fontSize: 18,
                color: '#5776df'
            }
        },
        color:['#9a99ff', '#cc715c'],
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
            orient: 'horizontal',
            left: 'center',
            top: '25',
            data: ['男', '女']
        },
        series: [
            {
                name: '人数',
                type: 'pie',
                radius: ['35%', '60%'],
                center: ['50%', '60%'],
                selectedMode: 'single',
                minAngle: 30,
                label: {
                    show: true,
                    position: 'outside',
                    formatter: '{c}',
                    fontSize: 16,
                },
                data: [
                    {value: 5988, name: '男'},
                    {value: 6012, name: '女'},
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    var myChart = echarts.init(document.querySelector('#chart11'));
    myChart.clear();
    myChart.setOption(option);

}
function chart13() {
    var myColor = [
        '#d32f2e', '#0098a6', '#c2175b', '#00796a',
        '#7b20a3', '#398e3d', '#512da7', '#b0b42b',
        '#31409f', '#fac02e', '#1b76d3', '#f67b02',
        '#0287d2'];

    var option = {
        tooltip : {
            formatter: function (params) {
                return params.seriesName + ': ' + (params.data)[2] + '<br/>人数: ' + (params.data)[1]
            }
        },
        grid: {
            show: true,
            top: '5%',
            left: '5%',
            right: '5%',
            bottom: '5%',
            containLabel: true
        },
        xAxis: {
            axisLabel: {show: false},
            splitLine: {show: false}
        },
        yAxis: {
            type: 'value',
            name: '人数',
            splitLine: {show: false}
        },
        series: [{
            name: '标签',
            type: 'scatter',
            hoverAnimation: true,
            symbolSize: function (value, params) {
                //console.log(Math.sqrt(value[1]));
                return Math.sqrt(value[1]);
            },
            label: {
                show: true,
                fontSize: 14,
                formatter: ' {@[2]}',
            },
            itemStyle: {
                color: function(params) {
                    return myColor[params.dataIndex]
                },
            },
            data: [
                [3, 534, '低保'],
                [5, 1564, '失独'],
                [7, 755, '纯老'],
                [9, 1456, '孤老'],
                [11, 5555, '独居'],
                [13, 3242, '纳保']
            ]
        }]
    };
    var myChart = echarts.init(document.querySelector('#chart13'));
    myChart.clear();
    myChart.setOption(option);

}

function chart221() {
    var myColor = [
        '#d32f2e', '#0098a6', '#c2175b', '#00796a',
        '#398e3d', '#512da7', '#b0b42b', '#0287d2',
        '#f67b02', '#fac02e', '#1b76d3', '#31409f'];
    var option = {
        title: {
            show: false
        },
        color: myColor,
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        /*legend: {
            orient: 'vertical',
            left: 'left',
            top: 'center',
            data: ['养老机构', '日间照料中心', '助餐服务点', '综合为老服务中心',
            '社区睦邻点', '老年活动室', '长护险护理站', '卫生服务点', '辅助器材租赁点']
        },*/
        series: [
            {
                name: '养老设施',
                type: 'pie',
                radius: '60%',
                center: ['50%', '50%'],
                data: [
                    {value: 6, name: '养老机构'},
                    {value: 2, name: '日间照料中心'},
                    {value: 4, name: '助餐服务点'},
                    {value: 2, name: '综合为老服务中心'},
                    {value: 8, name: '社区睦邻点'},
                    {value: 15, name: '老年活动室'},
                    {value: 2, name: '长护险护理站'},
                    {value: 2, name: '卫生服务点'},
                    {value: 10, name: '辅助器材租赁点'}
                ],
                label: {
                    show: true,
                    formatter: '{c}'
                },
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    var myChart = echarts.init(document.querySelector('#chart21'));
    myChart.clear();
    myChart.off('click');
    myChart.on('click', function (params) {
        showVendorList(params.value, params.name);
    });
    myChart.setOption(option);
}
function showVendorList(v, name) {
    console.log(v);
    //遍历

    $('#vName').text(' - ' + name);
    $('#vendorTableModal').modal('show');
}

function chart31() {
    var option = {
        title: {
            text: '长护险照护等级分布',
            left: 'center',
            top: 20,
            textStyle: {
                fontSize: 16,
                color: '#499EDF'
            }
        },
        color:['#bcbc6d', '#eeec6e'],
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            top: 'center',
            data: ['零级', '一级', '二级', '三级', '四级', '五级', '六级']
        },
        series: [
            {
                name: '人数',
                type: 'pie',
                top: 30,
                radius: ['40%', '55%'],
                center: ['60%', '50%'],
                selectedMode: 'single',
                minAngle: 30,
                label: {
                    show: true,
                    formatter: '{c}'
                },
                data: [
                    {value: 5988, name: '零级'},
                    {value: 6012, name: '一级'},
                    {value: 6012, name: '二级'},
                    {value: 6012, name: '三级'},
                    {value: 6012, name: '四级'},
                    {value: 6012, name: '五级'},
                    {value: 6012, name: '六级'},
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    var myChart = echarts.init(document.querySelector('#chart31'));
    myChart.clear();
    myChart.setOption(option);

}

function chart21() {
    var option = {
        title: {
            text: '政策保障',
            left: 'center',
            top: '10',
            textStyle: {
                fontSize: 16,
                color: '#5776df'
            }
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        color: ['#0287d2'],
        grid: {
            top: '20%',
            left: '5%',
            right: '5%',
            bottom: '10%',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            nameLocation: 'end',
            axisLabel: {
                show: false,
                interval: 0,
                rotate: 30,
                margin: 12 ,
                fontSize: 14
            },
            data: ['老年综合津贴', '三支回沪医疗补助', '银发无忧保险', '养老服务补贴']
        },
        yAxis: {
            type: 'value',
            name: '人数',
            axisLabel: {show: false},
            splitLine: {show: false}
        },
        series: [
            {
                name: '人数',
                type: 'line',
                symbol: 'circle',
                symbolSize: '10',
                label: {
                    show: true,
                    position: 'top'
                },
                data: [320, 202, 301, 434]
            }
        ]
    };
    var myChart = echarts.init(document.querySelector('#chart21'));
    myChart.clear();
    myChart.setOption(option);

}
function chart22() {
    var myColor = ['#fac02e', '#1b76d3', '#f67b02', '#d32f2e', '#0287d2',
        '#0098a6', '#c2175b', '#00796a',
        '#7b20a3', '#398e3d', '#512da7', '#b0b42b'];
    var option = {
        title: {
            text: '健康医疗',
            left: 'center',
            top: '10',
            textStyle: {
                fontSize: 16,
                color: '#5776df'
            }
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        color: myColor,
        grid: {
            top: '20%',
            left: '5%',
            right: '5%',
            bottom: '10%',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            nameLocation: 'end',
            axisLabel: {
                show: false,
                interval: 0,
                rotate: 30,
                margin: 12 ,
                fontSize: 14
            },
            data: ['长期护理保险', '家庭医生签约', '家庭床位', '老年人体检']
        },
        yAxis: {
            type: 'value',
            name: '人数',
            axisLabel: {show: false},
            splitLine: {show: false}
        },
        series: [
            {
                name: '人数',
                type: 'bar',
                barWidth: '45%',
                label: {
                    show: true,
                    position: 'top'
                },
                itemStyle: {
                    color: function(params) {
                        return myColor[params.dataIndex]
                    }
                },
                data: [320, 202, 301, 434]
            }
        ]
    };
    var myChart = echarts.init(document.querySelector('#chart22'));
    myChart.clear();
    myChart.setOption(option);

}
function chart23() {
    var option = {
        title: {
            text: '服务照料',
            left: 'center',
            top: '10',
            textStyle: {
                fontSize: 16,
                color: '#5776df'
            }
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        color: ['#5776df'],
        grid: {
            top: '20%',
            left: '5%',
            right: '5%',
            bottom: '10%',
            containLabel: true
        },
        xAxis: {
            type: 'category',
            nameLocation: 'end',
            boundaryGap: false,
            axisLabel: {
                show: false,
                interval: 0,
                rotate: 30,
                margin: 12 ,
                fontSize: 14
            },
            data: ['康乐福', '老伙伴服务对象', '老吾老计划', '过老化改造', '爬楼机租赁', '助餐']
        },
        yAxis: {
            type: 'value',
            name: '人数',
            axisLabel: {show: false},
            splitLine: {show: true}
        },
        series: [
            {
                name: '人数',
                type: 'line',
                areaStyle: {},
                label: {
                    show: true,
                    position: 'top'
                },
                data: [320, 702, 301, 434, 845, 500]
            }
        ]
    };
    var myChart = echarts.init(document.querySelector('#chart23'));
    myChart.clear();
    myChart.setOption(option);

}
function chart24() {
    var myColor = ['#fac02e', '#1b76d3', '#f67b02', '#d32f2e', '#0287d2',
        '#0098a6', '#c2175b', '#00796a',
        '#7b20a3', '#398e3d', '#512da7', '#b0b42b'];
    var option = {
        title: {
            text: '日常关爱',
            left: 'center',
            top: '10',
            textStyle: {
                fontSize: 16,
                color: '#5776df'
            }
        },
        color: myColor,
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        /*legend: {
            orient: 'horizontal',
            left: 'center',
            top: '25',
            data: ['男', '女']
        },*/
        series: [
            {
                name: '人数',
                type: 'pie',
                radius: '60%',
                center: ['50%', '55%'],
                selectedMode: 'single',
                minAngle: 30,
                label: {
                    show: true,
                    position: 'outside',
                    formatter: '{c}',
                    fontSize: 16,
                },
                data: [
                    {value: 345, name: '元旦春节慰问'},
                    {value: 128, name: '夏送清凉慰问'},
                    {value: 654, name: '敬老节慰问'},
                    {value: 444, name: '百岁老人慰问'},
                    {value: 248, name: '长寿面'}
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    var myChart = echarts.init(document.querySelector('#chart24'));
    myChart.clear();
    myChart.setOption(option);

}
function chart26() {
    var myColor = ['#fac02e', '#1b76d3', '#f67b02', '#d32f2e', '#0287d2',
        '#0098a6', '#c2175b', '#00796a',
        '#7b20a3', '#398e3d', '#512da7', '#b0b42b'];
    var option = {
        title: {
            text: '其他',
            left: 'center',
            top: '10',
            textStyle: {
                fontSize: 16,
                color: '#5776df'
            }
        },
        color: myColor,
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
        },
        /*legend: {
            orient: 'horizontal',
            left: 'center',
            top: '25',
            data: ['男', '女']
        },*/
        series: [
            {
                name:'人数',
                type:'funnel',
                left: '10%',
                top: 40,
                //x2: 80,
                bottom: 20,
                width: '80%',
                // height: {totalHeight} - y - y2,
                min: 0,
                max: 100,
                minSize: '0%',
                maxSize: '100%',
                sort: 'ascending',
                gap: 2,
                label: {
                    show: true,
                    position: 'inside'
                },
                labelLine: {
                    length: 10,
                    lineStyle: {
                        width: 1,
                        type: 'solid'
                    }
                },
                itemStyle: {
                    borderColor: '#fff',
                    borderWidth: 1
                },
                emphasis: {
                    label: {
                        fontSize: 20
                    }
                },
                data: [
                    {value: 90, name: '残疾人补贴'},
                    {value: 20, name: '计生'},
                    {value: 70, name: '救助帮困'},
                    {value: 50, name: '双拥'}
                ]
            }
        ]
    };
    var myChart = echarts.init(document.querySelector('#chart26'));
    myChart.clear();
    myChart.setOption(option);

}





